package com.ray.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ray.bean.AttendanceListBean;
import com.ray.bean.CustomerBean;
import com.ray.bean.DatatablesViewPageBean;
import com.ray.bean.DepartmentBean;
import com.ray.bean.MaterialBean;
import com.ray.bean.OrderInfoTemplateBean;
import com.ray.bean.PersonBean;
import com.ray.bean.ProcessBean;
import com.ray.bean.WorkshopProductionCycleBean;
import com.ray.exception.ServiceException;
import com.ray.mapper.BasicDataMapper;
import com.ray.mapper.OrderCreateMapper;
import com.ray.mapper.OrderInfoTemplateMapper;
import com.ray.pojo.MyUser;
/**
 * 
 * @author Shensg
 * 2018年1月26日
 */
@Service
public class OrderInfoTemplateService {
	@Autowired
	OrderInfoTemplateMapper orderInfoTemplateMapper;
	
	//保存html 模版
	public int saveAsOrderTemplate(OrderInfoTemplateBean bean) {
		// TODO Auto-generated method stub
		return orderInfoTemplateMapper.saveAsOrderTemplate(bean);
	}
	//通过ID获取相对应的模版
	public Map getTemplateById(OrderInfoTemplateBean bean) {
		// TODO Auto-generated method stub
		return orderInfoTemplateMapper.getTemplateById(bean);
	}
	public List<Map<String, String>> getTempList(Map map) {
		// TODO Auto-generated method stub
		return orderInfoTemplateMapper.getTempList(map);
	}
	public Map getTemplateInfoByOrderNo(Map map) {
		// TODO Auto-generated method stub
		return orderInfoTemplateMapper.getTemplateInfoByOrderNo(map);
	}
	/*模版列表*/	
	public DatatablesViewPageBean getTemplateList(Map map) {
		// TODO Auto-generated method stub
		DatatablesViewPageBean bean = new DatatablesViewPageBean();
		bean.setReturnData(orderInfoTemplateMapper.getTemplateList(map));
		bean.setiTotalDisplayRecords(orderInfoTemplateMapper.getTemplateListTotal(map));
		bean.setiTotalRecords(orderInfoTemplateMapper.getTemplateListTotal(map));
		return bean;
	}
	public void updateTemplateById(Map map) {
		orderInfoTemplateMapper.updateTemplateById(map);
	}


	
	
	
	
	
	
}
